<!--$Id: memp_set_maxsize.so,v 1.15 2005/09/17 16:30:18 bostic Exp $-->
<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB: DbMpoolFile::set_maxsize</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
</head>
<body bgcolor=white>
<table width="100%"><tr valign=top>
<td>
<b>DbMpoolFile::set_maxsize</b>
</td>
<td align=right>
<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a>
<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td>
</tr></table>
<hr size=1 noshade>
<tt>
<b><pre>
#include &lt;db_cxx.h&gt;
<p>
int
DbMpoolFile::set_maxsize(u_int32_t gbytes, u_int32_t bytes);
<p>
int
DbMpoolFile::get_maxsize(u_int32_t *gbytesp, u_int32_t *bytesp);
</pre></b>
<hr size=1 noshade>
<b>Description: DbMpoolFile::set_maxsize</b>
<p>Set the maximum size for the file to be <b>gbytes</b> gigabytes plus
<b>bytes</b>.  Attempts to allocate new pages in the file after the
limit has been reached will fail.</p>
<p>To set the maximum file size for a particular database, call the
DbMpoolFile::set_maxsize method using the <a href="../api_cxx/mempfile_class.html">DbMpoolFile</a> handle stored
in the <b>mpf</b> field of the <a href="../api_cxx/db_class.html">Db</a> handle.  Attempts to insert
new items into the database after the limit has been reached may fail.</p>
<p>The DbMpoolFile::set_maxsize method configures a file in the memory pool, not only
operations performed using the specified <a href="../api_cxx/mempfile_class.html">DbMpoolFile</a> handle.</p>
<p>The DbMpoolFile::set_maxsize method may be called at any time during the life of the
application.</p>
<p>The DbMpoolFile::set_maxsize method
either returns a non-zero error value
or throws an exception that encapsulates a non-zero error value on
failure, and returns 0 on success.
</p>
<b>Parameters</b> <br>
 <b>bytes</b><ul compact><li>The maximum size of the file is set to <b>gbytes</b> gigabytes plus
<b>bytes</b>.</ul>
 <b>gbytes</b><ul compact><li>The maximum size of the file is set to <b>gbytes</b> gigabytes plus
<b>bytes</b>.</ul>
<br>
<hr size=1 noshade>
<b>Description: DbMpoolFile::get_maxsize</b>
<p>The DbMpoolFile::get_maxsize method
either returns a non-zero error value
or throws an exception that encapsulates a non-zero error value on
failure, and returns 0 on success.
</p>
<p>The DbMpoolFile::get_maxsize method may be called at any time during the life of the
application.</p>
<b>Parameters</b> <br>
 <b>bytesp</b><ul compact><li>The <b>bytesp</b> parameter references memory into which
 the additional bytes of memory in the maximum file size is copied.</ul> 
 <b>gbytesp</b><ul compact><li>The <b>gbytesp</b> parameter references memory into which
 the gigabytes of memory in the maximum file size is copied.</ul> 
<br>
<hr size=1 noshade>
<br><b>Class</b>
<a href="../api_cxx/env_class.html">DbEnv</a>, <a href="../api_cxx/mempfile_class.html">DbMpoolFile</a>
<br><b>See Also</b>
<a href="../api_cxx/memp_list.html">Memory Pools and Related Methods</a>
</tt>
<table width="100%"><tr><td><br></td><td align=right>
<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a>
</td></tr></table>
<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
</body>
</html>
